-- GENERATED SPELL FOR [Stinkbeard] --


function spell0_30017(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(50420,pUnit)
pUnit:RegisterEvent('Sorts_30017', 590, 1)
end

function spell1_30017(pUnit, Event) --@Knock Away,n/a--
pUnit:FullCastSpellOnTarget(31389,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30017', 615, 1)
end

function spell2_30017(pUnit, Event) --@Stinky Beard,Self--
pUnit:FullCastSpellOnTarget(55867,pUnit)
pUnit:RegisterEvent('Sorts_30017', 30252, 1)
end

function spell3_30017(pUnit, Event) --@Thunderblade,Self--
pUnit:FullCastSpellOnTarget(55866,pUnit)
pUnit:RegisterEvent('Sorts_30017', 659, 1)
end

function spell4_30017(pUnit, Event) --@Thunderclap,Self--
pUnit:FullCastSpellOnTarget(15588,pUnit)
pUnit:RegisterEvent('Sorts_30017', 10330, 1)
end

function Sorts_30017(pUnit, Event)
local choix_sorts_30017 = math.random(0, 4)
if choix_sorts_30017 == 0 then
pUnit:RegisterEvent('spell0_30017', 1, 1)
end
if choix_sorts_30017 == 1 then
pUnit:RegisterEvent('spell1_30017', 1, 1)
end
if choix_sorts_30017 == 2 then
pUnit:RegisterEvent('spell2_30017', 1, 1)
end
if choix_sorts_30017 == 3 then
pUnit:RegisterEvent('spell3_30017', 1, 1)
end
if choix_sorts_30017 == 4 then
pUnit:RegisterEvent('spell4_30017', 1, 1)
end
end

function mob30017_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_30017', math.random(1500, 3000), 1)
end

function mob30017_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob30017_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob30017_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(30017, 1, 'mob30017_Action')
RegisterUnitEvent(30017, 2, 'mob30017_Leave')
RegisterUnitEvent(30017, 3, 'mob30017_Kill')
RegisterUnitEvent(30017, 4, 'mob30017_Die')
